// import Home from '@/components/layout/Home'
// import Index from '@/components/views/Index'
import store from '@/store';
let Home = resolve => require(['@/components/layout/Home2'], resolve);
let login = resolve => require(['@/components/pages/Login'], resolve);
// let index = resolve => require(['@/components/views/Index'], resolve);
let index = resolve => require(['@/components/views/home'], resolve);
let notFound = resolve => require(['@/components/pages/NotFound'], resolve);
let userInfo = resolve => require(['@/components/views/UserInfo'], resolve);
let E404 = resolve => require(['@/components/pages/E404'], resolve);
let vod = resolve => require(['@/views/sys/vod.vue'], resolve);
let livevideo = resolve => require(['@/views/sys/livevideo.vue'], resolve);
let history = resolve => require(['@/views/sys/history'], resolve);
let organizationManage = resolve => require(['@/views/sys/organizationManage'], resolve);
let userManage = resolve => require(['@/views/sys/userManage'], resolve);
let role = resolve => require(['@/views/sys/role'], resolve);
let roleassign = resolve => require(['@/views/sys/roleassign'], resolve);
let resource = resolve => require(['@/views/sys/resource'], resolve);
let logs = resolve => require(['@/views/sys/logs'], resolve);
let statisticsUser = resolve => require(['@/views/sys/statisticsUser'], resolve);
let statisticsVideo = resolve => require(['@/views/sys/statisticsVideo'], resolve);
let statisticsLive = resolve => require(['@/views/sys/statisticsLive'], resolve);
let statisticsOrg = resolve => require(['@/views/sys/statisticsOrg'], resolve);
let statisticsStore = resolve => require(['@/views/sys/statisticsStore'], resolve);
let bulletin = resolve => require(['@/views/sys/bulletin'], resolve);
let userM = resolve => require(['@/views/sys/userM'], resolve);
let dept = resolve => require(['@/views/sys/dept'], resolve);
let liveManage = resolve => require(['@/views/sys/liveManage'], resolve);
let vodManage = resolve => require(['@/views/sys/vodManage'], resolve);
let echarts = resolve => require(['@/views/sys/echarts'], resolve);
let flowchat = resolve => require(['@/views/sys/flowchat'], resolve);
let flowInst = resolve => require(['@/components/flowchat/flowInst'], resolve);
let flow = resolve => require(['@/views/sys/flow'], resolve);
let Action = resolve => require(['@/views/sys/action'], resolve);
let Event = resolve => require(['@/views/sys/eventM'], resolve);

let DeptParams = resolve => require(['@/views/ims/params/DeptParams'], resolve);

let SchoolDeclare = resolve => require(['@/views/ims/SchoolDeclare'], resolve);

let CollegeDeclare = resolve => require(['@/views/ims/CollegeDeclare'], resolve);

// params
let SetParams = resolve => require(['@/views/ims/SetParams'], resolve);
let Professor = resolve => require(['@/views/ims/params/Professor'], resolve);
let SetProfessorGroup = resolve => require(['@/views/ims/params/SetProfessorGroup'], resolve);
let Sequence = resolve => require(['@/views/ims/params/Sequence.vue'], resolve);


let routes = [{
  path: '/login',
  name: 'login',
  component: login,
  hidden: true,
  beforeEnter: (to, from, next) => {
    // console.log(store.state)
    if (store.state.app.isLogin) {
      next('/index');
    } else {
      next();
    }
  }
},
{
  path: '/',
  component: Home,
  name: 'Home',
  iconCls: 'stats-bars',
  redirect: {
    path: '/index'
  },
  children: 
  [
    {
      path: '/index',
      component: index,
      name: '首页',
      hidden: true
    },
    {
      path: '/userInfo',
      component: userInfo,
      name: '用户信息',
      hidden: true
    },
    {
      path: '/main',
      component: echarts,
      name: '主页',
      hidden: true
    },
    {
      path: '/vod',
      component: vod,
      name: '点播频道'
    },
    {
      path: '/livevideo',
      component: livevideo,
      name: '直播频道'
    },
    {
      path: '/history',
      component: history,
      name: '观看历史'
    },

    {
      path: '/organizationManage',
      component: organizationManage,
      name: '学校管理'
    },
    {
      path: '/userManage',
      component: userManage,
      name: '用户管理'
    },
    {
      path: '/role',
      component: role,
      name: '角色管理'
    },
    {
      path: '/roleassign',
      component: roleassign,
      name: '角色授权'
    },
    {
      path: '/resource',
      component: resource,
      name: '资源管理'
    },
    {
      path: '/logs',
      component: logs,
      name: '操作日志'
    },



    // {path: '/dashboard', component: dashboard, name: '综合分析'},
    {
      path: '/statisticsStore',
      component: statisticsStore,
      name: '存储空间'
    },
    {
      path: '/statisticsOrg',
      component: statisticsOrg,
      name: '单位统计'
    },
    {
      path: '/statisticsUser',
      component: statisticsUser,
      name: '人员统计'
    },
    {
      path: '/statisticsVideo',
      component: statisticsVideo,
      name: '视频统计'
    },
    {
      path: '/statisticsLive',
      component: statisticsLive,
      name: '直播统计'
    },

    {
      path: '/bulletin',
      component: bulletin,
      name: '公告管理'
    },
    {
      path: '/userM',
      component: userM,
      name: '人员管理'
    },
    {
      path: '/dept',
      component: dept,
      name: '学院管理'
    },


    {
      path: '/flow',
      component: flow,
      name: '流程管理'
    },
    {
      path: '/flowchat',
      component: flowchat,
      name: '流程详情'
    },
    {
      path: '/flowInst',
      component: flowInst,
      name: '流程实例'
    },
    {
      path: '/flow',
      component: flow,
      name: '流程定义'
    },
    {
      path: '/actionM',
      component: Action,
      name: '动作管理'
    },
    {
      path: '/eventM',
      component: Event,
      name: '事件管理'
    },



    {
      path: '/liveManage',
      component: liveManage,
      name: '直播频道管理'
    },
    {
      path: '/vodManage',
      component: vodManage,
      name: '点播资源管理'
    },

    // dept_project
    {
      path: 'sequence',
      component: Sequence,
      name: '批次'
    },
    {
      path: '/dept_project',
      component: DeptParams,
      name: '项目设置'
    }, 
    {
      path: '/ims_school_declare',
      component: SchoolDeclare,
      name: '校级立项'
    },
    {
      path: '/ims_college_declare',
      component: CollegeDeclare,
      name: '院系立项'
    },
    {
      path: '/ims_project_params',
      component: SetParams,
      name: '项目参数设置'
    },
    {
      path: '/professor',
      component: Professor,
      name: '专家组'
    },
    {
      path: '/set_professor_group',
      component: SetProfessorGroup,
      name: '专家组配置'
    },
    // 立项
    {
      path: '/project_information',
      component: resolve => require(['@/views/ims/projectSetUp/MyProject'], resolve),
      name: '项目申请'
    },
    {
      path: 'project_chuangxin_information',
      component: resolve => require(['@/views/ims/projectSetUp/Chuangxin'], resolve),
      name: '创新训练'
    },
    {
      path: 'project_chuangye_information',
      component: resolve => require(['@/views/ims/projectSetUp/Chuangye'], resolve),
      name: '创业训练'
    },
    {
      path: 'project_chuangxing_information',
      component: resolve => require(['@/views/ims/projectSetUp/Chuangxing'], resolve),
      name: '创业实践'
    },
    {
      path: '/project_info',
      component: resolve => require(['@/views/ims/projectSetUp/ProjectInfo'], resolve),
      name: '审核中立项'
    },
    {
      path: '/project_setup_enable',
      component: resolve => require(['@/views/ims/projectSetUp/Enable'], resolve),
      name: '已通过立项'
    },
    {
      path: '/project_setup_dusable',
      component: resolve => require(['@/views/ims/projectSetUp/Disable'], resolve),
      name: '未通过立项'
    },
    {
      path: '/project_detail_info',
      component: resolve => require(['@/views/ims/projectSetUp/ProjectInfoDetail'], resolve),
      name: '项目详情'
    },
    {
      path: '/setup_approve',
      component: resolve => require(['@/views/ims/projectSetUp/SetupApprove'], resolve),
      name: '立项审批',
      children: [
        {
          path: '',
          component: resolve => require(['@/views/ims/projectSetUp/Approve'], resolve),
          name: '待审核立项'
        },
        {
          path: 'approved',
          component: resolve => require(['@/views/ims/projectSetUp/Approved'], resolve),
          name: '已审核立项'
        }
        
      ]
    },
    {
      path: 'project_approve',
      component: resolve => require(['@/views/ims/auditing/Auditing'], resolve),
      name: '项目审核'
    },
    // 中期检查
    {
      path: '/project_check',
      component: resolve => require(['@/views/ims/check/ProjectInfo'], resolve),
      name: '审核中检查'
    },
    {
      path: '/project_check_enable',
      component: resolve => require(['@/views/ims/check/Enable'], resolve),
      name: '已通过中期检查'
    },
    {
      path: '/project_check_dusable',
      component: resolve => require(['@/views/ims/check/Disable'], resolve),
      name: '未通过中期检查'
    },
    {
      path: '/project_medium_term',
      component: resolve => require(['@/views/ims/check/MediumTerm'], resolve),
      name: '中期检查报告'
    },
    // {
    //   path: '/project_detail_info',
    //   component: resolve => require(['@/views/ims/projectSetUp/ProjectInfoDetail'], resolve),
    //   name: '项目详情'
    // },
    {
      path: '/check_approve',
      component: resolve => require(['@/views/ims/check/Check'], resolve),
      name: '中期检查审批',
      children: [
        {
          path: 'approve',
          component: resolve => require(['@/views/ims/check/Approve'], resolve),
          name: '待审核中期检查'
        },
        {
          path: 'approved',
          component: resolve => require(['@/views/ims/check/Approved'], resolve),
          name: '已审核中期检查'
        }
        
      ]
    },
    // 结项
    {
      path: '/project_infish',
      component: resolve => require(['@/views/ims/finish/ProjectInfo'], resolve),
      name: '审核中结题'
    },
    {
      path: '/project_finish_enable',
      component: resolve => require(['@/views/ims/finish/Enable'], resolve),
      name: '已通过结题'
    },
    {
      path: '/project_finish_dusable',
      component: resolve => require(['@/views/ims/finish/Disable'], resolve),
      name: '未通过结题'
    },
    {
      path: '/project_finish_report',
      component: resolve => require(['@/views/ims/finish/FinishReport'], resolve),
      name: '结项报告'
    },
    // {
    //   path: '/project_detail_info',
    //   component: resolve => require(['@/views/ims/projectSetUp/ProjectInfoDetail'], resolve),
    //   name: '项目详情'
    // },
    {
      path: '/finish_approve',
      component: resolve => require(['@/views/ims/finish/Finish'], resolve),
      name: '结题审批',
      children: [
        {
          path: '',
          component: resolve => require(['@/views/ims/finish/Approve'], resolve),
          name: '待审核结题'
        },
        {
          path: 'approved',
          component: resolve => require(['@/views/ims/finish/Approved'], resolve),
          name: '已审核结题'
        }       
      ]
    },
    // 变更
    {
      path: '/project_change',
      component: resolve => require(['@/views/ims/change/ProjectInfo'], resolve),
      name: '审核中项目变更'
    },
    {
      path: '/project_change_details',
      component: resolve => require(['@/views/ims/change/ChangeDetail'], resolve),
      name: '项目变更详情'
    },
    {
      path: '/project_finish_enable',
      component: resolve => require(['@/views/ims/change/Enable'], resolve),
      name: '已通过项目变更'
    },
    {
      path: '/project_finish_dusable',
      component: resolve => require(['@/views/ims/change/Disable'], resolve),
      name: '未通过项目变更'
    },
    {
      path: '/project_change_chuangxin',
      component: resolve => require(['@/views/ims/change/Chuanxin'], resolve),
      name: '创新训练项目变更'
    },
    {
      path: '/project_change_chuangye',
      component: resolve => require(['@/views/ims/change/Changye'], resolve),
      name: '创业训练项目变更'
    }, {
      path: '/project_change_chuangxing',
      component: resolve => require(['@/views/ims/change/Chuangxing'], resolve),
      name: '创业实践项目变更'
    },
    // {
    //   path: '/project_detail_info',
    //   component: resolve => require(['@/views/ims/projectSetUp/ProjectInfoDetail'], resolve),
    //   name: '项目详情'
    // },
    {
      path: '/change_approve',
      component: resolve => require(['@/views/ims/change/Change'], resolve),
      name: '项目变更审批',
      children: [
        {
          path: '',
          component: resolve => require(['@/views/ims/change/Approve'], resolve),
          name: '待审核项目变更'
        },
        {
          path: 'approved',
          component: resolve => require(['@/views/ims/change/Approved'], resolve),
          name: '已审核项目变更'
        }       
      ]
    },
    // 经费管理

    {
      path: '/project_outlay',
      component: resolve => require(['@/views/ims/outlay/ProjectList'], resolve),
      name: '已启动项目'
    },
    {
      path: '/project_liege',
      component: resolve => require(['@/views/ims/outlay/OutlayList'], resolve),
      name: '预算清单'
    },
    {
      path: '/project_budget_used',
      component: resolve => require(['@/views/ims/outlay/BudgetUsed'], resolve),
      name: '预算使用情况'
    },
    {
      path: '/project_budget',
      component: resolve => require(['@/views/ims/projectManager/projectManager'], resolve),
      name: '项目管理'
    },

    // cms 菜单管理
    {
      path: '/menus',
      component: resolve => require(['@/views/cms/InformationManger/menus'], resolve),
      name: '菜单管理'
    },
    {
      path: '/article',
      component: resolve => require(['@/views/cms/InformationManger/articles'], resolve),
      name: '新闻管理'
    },
    {
      path: '/cms_editor',
      component: resolve => require(['@/views/cms/InformationManger/editor'], resolve),
      name: 'cms_editor'
    },

    // 专业管理
    {
      path: 'major',
      component: resolve => require(['@/views/sys/major.vue'], resolve),
      name: '专业管理'
    }

  ]
},
{
  path: '/error404',
  name: 'error404',
  component: E404
},
{
  path: '*',
  redirect: '/notFound'
},
{
  path: '/404',
  component: notFound,
  name: '',
  hidden: true
}
];

export default routes;
